#!/bim/bash
echo "Enter array size"
read n
echo "Enter elements of array"
for((i=0;i<n;i++))
do
	read arr[$i]
done

for((i=0;i<n;i++))
do
	for((j=$i;j<n;j++))
	do
		if [ ${arr[$i]} -gt ${arr[$j]} ]
		then
		t=${arr[$i]}
		arr[$i]=${arr[$j]}
		arr[$j]=$t
		fi
	done
done
echo "sorted elements are as follows"
for((i=0;i<n;i++))
do
	echo ${arr[$i]}
done

